<?php $this->load->view('header', array('data' => $data));?>
<div id="center">
	<div id="left_box">
		<div class="module"><div class="text">用户管理</div></div>
		<div class="sub_module">
		<ul class="sub_module">
		<?php foreach ($data['module'][$data['current']['module']]['sub_module'] as $v) { ?>
			<li <?php if ($v['ename'] == $data['current']['sub_module']) echo "class='current'"; ?> ><a href="<?php echo "/{$data['current']['module']}/{$v['ename']}";?>"><?php echo $v['cname'];?></a></li>
		<?php }?>
		</ul>
		</div>
		<div class="desc_box1 desc_box">
			<div class="title"></div>
			<div class="content"></div>
		</div>
		<div class="desc_box2 desc_box">
			<div class="title"></div>
			<div class="content"></div>
		</div>
	</div>
	<div id="right_box">
		<fieldset id="select_user">
			<legend>选择用户</legend>
   			<select id="atype">
       			<option>请选择类型...</option>
       			<option>用户</option>
       			<option>组</option>
   			</select>
   			<select class="user">
   				<option value="0">请选择...</option>
   			</select>
   			<select class="user user_id" >
   				<option value="0">请选择...</option>
			<?php foreach ($data['all_user'] as $v) {?>
       			<option value="<?php echo $v['id']; ?>"><?php echo $v['username']; ?></option>
			<?php } ?>
   			</select>  
   			<select class="user group_id" >
   				<option value="0">请选择...</option>
			<?php foreach ($data['all_group'] as $v) {?>
       			<option value="<?php echo $v['id']; ?>"><?php echo $v['username']; ?></option>
			<?php } ?>
   			</select>  
			<input type="button" value="确定" id="select_button" />
		</fieldset>
<?if ($data['flag']) {?>
		<fieldset id="edit_user">
			<legend>编辑用户信息</legend>
			<form method="post" action="edit_do" id="edit_user_form">
			<input type="hidden" name="id" value="<?php echo $data['user']['id'];?>">
			<table>
				<tr>
					<td class="col1">用户名</td>
					<td class="col2"><input type="text" id="username" name="username" disabled="disabled" value="<?php echo "{$data['user']['username']}"; ?>" size="30" /></td>
					<td class="col3"><div id="username_msg"></div></td>
				</tr>
				<tr>
					<td class="col1">密码</td>
					<td class="col2"><input type="password" id="password" name="password" value="" size="30" /></td>
					<td class="col3"><div id="password_msg"></div></td>
				</tr>
				<tr>
					<td class="col1">重复密码</td>
					<td class="col2"><input type="password" id="repassword" name="repassword" value="" size="30" /></td>
					<td class="col3"><div id="repassword_msg"></div></td>
				</tr>
				<tr>
					<td class="col1">用户类型</td>
					<td class="col2">
						<input type="radio" name="atype" value="1" <?php if ($data['user']['atype'] == 1) echo 'checked="checked"'; ?> >个人用户
						<input type="radio" name="atype" value="2" <?php if ($data['user']['atype'] == 2) echo 'checked="checked"'; ?> >用户组
					</td>
				</tr>
				<tr>
					<td class="col1">手机</td>
					<td class="col2"><input type="text" id="mobile" name="mobile" value="<?php echo $data['user']['mobile']; ?>" size="30" /></td>
					<td class="col3"><div id="mobile_msg"></div></td>
				</tr>
				<tr>
					<td class="col1">Email</td>
					<td class="col2"><input type="text" id="email" name="email" value="<?php echo $data['user']['email']; ?>" size="30" /></td>
					<td class="col3"><div id="email_msg"></div></td>
				</tr>
				<tr>
					<td class="col1">备注</td>
					<td class="col2"><textarea name="remark" id="remark" cols="30" rows="5"><?php echo $data['user']['remark']; ?></textarea></td>
					<td class="col3"><div id="remark_msg"></div></td>
				</tr>
				<tr>
					<td class="col1"><input type="submit" value="修改" /><input type="reset" value="重置" /></td>
					<td class="col2"></td>
				</tr>
			</table>
		</form>
		</fieldset>
<?php } ?>
	</div>
</div>
<?php $this->load->view('footer') ?>
